<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
    function print(id){
        printPdf('${ctx}/oper/patMasterIndex/printRegisit','id='+id);
    }
</script>
    <div class="content-wrap">
        <div class="wrapper" style="bottom: 50px;">
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="#"   onclick="loadDiv('mainCenterDiv','${ctx}/oper/clinicMaster/searchRegister')">挂号查询</a>
                </li>
            </ul>
            <section class="panel panel-default">
                <div class="panel-body">
                    <div class="table-responsive no-border">
                        <div class="datatable-top">
                            <div class="pull-left">
                            	<form:form id="searchForm" modelAttribute="clinicMaster"  onsubmit="return loadDivForm('mainCenterDiv','searchForm','${ctx}/oper/clinicMaster/searchRegister');" method="post" class="form-inline">
                                    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                    <label>挂号人：</label>
                                    <form:input path="createBy.name" htmlEscape="false" maxlength="50" class="form-control" cssStyle="width: 100px;"/>
                                    &nbsp;&nbsp;
                                    <label>退号人：</label>
                                    <form:input path="registOperator" htmlEscape="false" maxlength="50" class="form-control" cssStyle="width: 100px;"/>
                                    &nbsp;&nbsp;
                                    <label>就诊时间:</label>
                                    <input name="visitDate" value="<fmt:formatDate value="${clinicMaster.visitDate}" pattern="yyyy-MM-dd"></fmt:formatDate>" class="form-control Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});">
                                    &nbsp;&nbsp;
                                    <label>挂号状态:</label>
                                    <select class="form-control" name="clinicType">
                                        <option value="0" <c:if test="${clinicMaster.clinicType=='0'}">selected="selected" </c:if>>未就诊</option>
                                        <option value="1" <c:if test="${clinicMaster.clinicType=='1'}">selected="selected" </c:if>>已就诊</option>
                                        <option value="2" <c:if test="${clinicMaster.clinicType=='2'}">selected="selected" </c:if>>已退号</option>
                                    </select>
                                    &nbsp;&nbsp;
                                    <lable>病人姓名：</lable>
                                    <form:input path="name" htmlEscape="false" class="form-control" cssStyle="width: 100px;"></form:input>
                                    &nbsp;&nbsp;
                                    <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
                                </form:form>
                            </div>
                        </div>
                        <table id="contentTable" class="table table-bordered mg-t datatable">
                            <thead>
                                <tr>
                                    <th>挂号人</th>
                                    <th>退号人</th>
                                    <th>号别</th>
                                    <th>就诊日期</th>
                                    <th>门诊号</th>
                                    <th>姓名</th>
                                    <th>挂号状态</th>
                                    <th>实收费用</th>
                                    <th>支付方式</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${page.list}" var="clinicMaster">
                                <tr>
                                        <td>${clinicMaster.createBy.id}</td>
                                        <td>${clinicMaster.registOperator}</td>
                                        <td> ${clinicMaster.clinicForRegist.clinicLabel}</td>
                                        <td> <fmt:formatDate value="${clinicMaster.visitDate}" pattern="yyyy-MM-dd"></fmt:formatDate></td>
                                        <td> ${clinicMaster.clinicNo}</td>
                                        <td> ${clinicMaster.name}</td>
                                        <td>
                                            <c:if test="${clinicMaster.clinicType == 0}">未就诊</c:if>
                                            <c:if test="${clinicMaster.clinicType == 1}">已就诊</c:if>
                                            <c:if test="${clinicMaster.clinicType == 2}">已退号</c:if>
                                        </td>
                                        <td> ${clinicMaster.clinicChage}</td>
                                        <td> ${fns:getDictLabel(clinicMaster.type, 'PAY_WAY_DICT', '')}</td>
                                        <td><a href="#"  class="btn btn-success btn-xs" onclick=print('${clinicMaster.id}')>打印</a></td>
                                </tr>
                            </c:forEach>

                        </table>
                        <div class="pagination">${page}</div>
                    </div>
                </div>
            </section>
        </div>
    </div>